package com.csdj.s3project.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.csdj.s3project.entity.Picture;
import com.csdj.s3project.entity.User;
import com.csdj.s3project.mapper.PictureMapper;
import com.csdj.s3project.service.IPictureService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zq
 * @since 2022-01-17
 */
@Service
public class PictureService extends ServiceImpl<PictureMapper, Picture> implements IPictureService {
    private Logger log = LoggerFactory.getLogger("pictureservice");
    @Resource
    private PictureMapper pictureMapper;

    @Override
    public List<Picture> selectShouYePicture() {
        QueryWrapper<Picture> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("ptype", 1);
        List<Picture> plist = pictureMapper.selectList(queryWrapper);
        if (plist != null) {
            return plist;
        }
        return null;
    }

    @Override
    public List<Picture> selectGuangGaoPicture() {
        QueryWrapper<Picture> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("ptype", 0);
        List<Picture> plist = pictureMapper.selectList(queryWrapper);
        if (plist == null) {
            return null;
        }
        return plist;
    }
}
